import { UserLayout, TabLayout, RouteView, BlankLayout, PageView, LayoutTest } from '@/components/layouts'

/**
 * 
 * 走菜单，走权限控制
 * @type {[null,null]}
 */
export const asyncRouterMap = [
  {
    path: '/',
    name: 'dashboard',
    component: TabLayout,
    meta: { title: '首页' },
    redirect: '/dashboard/workplace',
    children: [
      
    ]
  },
  {
    path: '*', redirect: '/404', hidden: true
  }
]


/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import('@/views/user/Login')
        
      },
      {
        path: '/BeforenoticeDetail',
        component: BlankLayout,
        redirect: '/BeforenoticeDetail',
        children: [
          {
            path: '/',
            name: 'BeforenoticeDetail',
            component: () => import('@/components/layouts/BeforenoticeDetail')
          }
        ]
      },
      {
        path: 'register',
        name: 'register',
        component: () => import('@/views/user/Register')
      },
      
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import('@/views/user/RegisterResult')
      },
      {
        path: 'alteration',
        name: 'alteration',
        component: () => import('@/views/user/Alteration')
      },
    ]
  },
  // 登陆前首页中药品详情路由
  {
      path: '/knowlage/detail',
      name:"KnowlageDetail",
      component: () => import('@/components/beforeLoginKnoelage/medicationDetail')
  },
  // 登陆前首页中知识库中医学图形库详情
  {
      path: '/newlist/detail',
      name:"NewList",
      component: () => import('@/components/beforeLoginKnoelage/newDetail')
  },
  // 通知公告详情
  {
      path: '/notice/detail',
      name:"BeforeNoticeDetail",
      component: () => import('@/components/layouts/BeforenoticeDetail')
  },
  {
    path: '/beforenotice/beforenoticedetail',
    component: import('@/components/layouts/BeforenoticeDetail'),
    name: 'BeforeNoticeDetail'
  },
  {
    path: '/test',
    component: BlankLayout,
    redirect: '/test/home',
  },
  {
    path: '/namelist',
    component: BlankLayout,
    redirect: '/namelist/home',
    children: [
      {
        path: 'home',
        name: 'Namelist',
        component: () => import('@/components/knowlage/namelist')
      }
    ]
  },
  {
    path: '/medicalGraphicsLibrarylist',
    component: BlankLayout,
    redirect: '/medicalGraphicsLibrarylist/home',
    children: [
      {
        path: 'home/:id',
        name: 'MedicalGraphicsLibrarylist',
        meta: { title: '医学图形库详情' },
        component: () => import('@/components/knowlage/medicalGraphicsLibrarylist')
      }
    ]
  },{
    path: '/knowledgeBase/diseaseKnowledgelist/home:id',
    name: 'DiseaseKnowledgelist',
    meta:{title: '疾病详情'},
    component:  () => import('@/components/knowlage/diseaseKnowledge'),
  },{
    path: '/knowledgeBase/inspectionInspectionlist',
    component: BlankLayout,
    redirect: '/knowledgeBase/inspectionInspectionlist/home',
    children: [
      {
        path: 'home/:id',
        name: 'InspectionInspectionlist',
        meta: { title: '检查详情' },
        component: () => import('@/components/knowlage/inspectionInspection')
      }
    ]
  },{
    path: '/knowledgeBase/medicationRecommendationslist/home/:id',
    name: 'MedicationRecommendationslist',
    meta: { title: '用药详情' },
    component: () => import('@/components/knowlage/medicationRecommendations')
  },{
    path: '/knowledgeBase/periodicalLiteraturelist',
    component: BlankLayout,
    redirect: '/knowledgeBase/periodicalLiteraturelist/home',
    children: [
      {
        path: 'home/:id',
        name: 'PeriodicalLiteraturelist',
        meta: {title: "周刊详情"},
        component: () => import('@/components/knowlage/periodicalLiteraturelist')
      }
    ]
  },{
    path: '/BeforenoticeDetail',
    component: BlankLayout,
    redirect: '/BeforenoticeDetail',
    children: [
      {
        path: '/',
        name: 'BeforenoticeDetail',
        component: () => import('@/components/layouts/BeforenoticeDetail')
      }
    ]
  },{
    path: '/knowledgeBase/pastTypicallist',
    component: BlankLayout,
    redirect: '/knowledgeBase/pastTypicallist/home',
    children: [
      {
        path: 'home/:id',
        name: 'PastTypicallist',
        meta: {title: "既往典型详情"},
        component: () => import('@/components/knowlage/pastTypicallist')
      }
    ]
  },

  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  },

]
